Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Modify  the  DNS  Server  Search  Order  for  a  Network  Adapter  

 Content of Modify the DNS Server Search Order for a Network Adapter.vbs
MD5 Hash: 8E5C3618A44554D1C82D51AAF2BB7F46
' Description: Configures a TCP/IP-bound network adapter to use two DNS servers: 192.168.1.100 and 192.168.1.200. Note that even if a computer only uses one DNS server, the IP address of that server must still be passed to the SetDNSServerSearchOrder method as an array (in that case, an array with only one element).


On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For Each objNetCard in colNetCards
arrDNSServers = Array("192.168.1.100", "192.168.1.200")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
Next

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a